package com.stu.moudle.config.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class RedisProperties {

    @Value("${redis.config.model}")
    private String model;
    @Value("${redis.config.cluster-nodes}")
    private String clusterNodes;
    @Value("${redis.config.max-redirects}")
    private Integer maxRedirects;
    @Value("${redis.config.password}")
    private String password;
    @Value("${redis.config.master}")
    private String master;
    @Value("${redis.config.sentinel-nodes}")
    private String sentinelNodes;

    @Value("${redis.config.host}")
    private String hostName;
    @Value("${redis.config.port}")
    private Integer port;

    @Resource
    private Pool pool;

    public String getHostName() {
        return hostName;
    }

    public void setHostName(String hostName) {
        this.hostName = hostName;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getClusterNodes() {
        return clusterNodes;
    }

    public void setClusterNodes(String clusterNodes) {
        this.clusterNodes = clusterNodes;
    }

    public Integer getMaxRedirects() {
        return maxRedirects;
    }

    public void setMaxRedirects(Integer maxRedirects) {
        this.maxRedirects = maxRedirects;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Pool getPool() {
        return pool;
    }

    public void setRedisPool(Pool pool) {
        this.pool = pool;
    }

    public String getMaster() {
        return master;
    }

    public void setMaster(String master) {
        this.master = master;
    }

    public String getSentinelNodes() {
        return sentinelNodes;
    }

    public void setSentinelNodes(String sentinelNodes) {
        this.sentinelNodes = sentinelNodes;
    }

    public static final String CLUSTER = "cluster";

    public static final String SINGLETON = "singleton";

    public static final String SENTINEL = "sentinel";
}
